class Node:
    def __init__(self, initdata):

        self._data = initdata
        self._next = None

    def getData(self):
        return self._data

    def getNext(self):
        return self._next

    def setData(self, newdata):
        # if newdata is not int:
        #     raise TypeError
        #     newdata = 0
        self._data = newdata

    def setNext(self, newnext):
        self._next = newnext

    def __str__(self):
        return str(self._data)


if __name__ == "__main__":
    node = Node(0)
    print(node.getData())

    node.setData(1)
    print(node.getData())

    node._data = 2
    print(node.getData())
